package com.example.demospringmybatisplus.enums;

import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 表名及对应服务枚举类
 *
 * @author
 * @DATE 2024/5/3
 **/
@Getter
@AllArgsConstructor
public enum TableNameServiceEnum {

    NODE("nodeVo", "nodeProcessorService"),
    NODE_AUTO("nodeAutoVo", "nodeAutoProcessorService");
    private String tableName;
    private String serviceName;
    public static Map<String, String> map = new HashMap<>();

    static {
        Arrays.stream(values()).forEach(v->map.put(v.getTableName(),v.getServiceName()));
    }

    public static String getServiceName(String tableName){
        return map.get(tableName);
    }
}
